const Sequelize = require('sequelize');

module.exports = function(sequelize, Sequelize) {
    return sequelize.define('barTableInfo', {
        barID: {
            type: Sequelize.INTEGER(8),
            allowNull: false,
            comment: "酒吧id"
        },
        tableNum: {
            type: Sequelize.INTEGER(8),
            allowNull: false,
            comment: "桌号"
        },
        state: {
            type: Sequelize.BOOLEAN(true),
            allowNull: false,
            comment: "桌号状态,有人(true),没人(false)"
        }
    }, {
        indexes: [
            {
                unique: true,
                fields: ['barID', 'tableNum']
            }
        ]
    });

}